using System;
using Spring.Context;
using Spring.Context.Support;

namespace SpringSeries.Core.ObjectScope
{
    class Program
    {
        static void Main(string[] args)
        {
            IApplicationContext _ctx = ContextRegistry.GetContext();

            EnglishToItalianTranslator _translator1 = (EnglishToItalianTranslator)_ctx.GetObject("TranslatorSingleton");
            EnglishToItalianTranslator _translator2 = (EnglishToItalianTranslator)_ctx.GetObject("TranslatorSingleton");

            Console.WriteLine((_translator1 == _translator2));

            EnglishToItalianTranslator _translator3 = (EnglishToItalianTranslator)_ctx.GetObject("TranslatorPrototype");
            EnglishToItalianTranslator _translator4 = (EnglishToItalianTranslator)_ctx.GetObject("TranslatorPrototype");

            Console.WriteLine((_translator3 == _translator4));

            Console.Read();
        }
    }
}
